<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<title>仓库管理</title>
<style type="text/css">
	#content{
		height: 450px;
		border: 1px solid #EEDC82;
	}
	#p{
		color: #1166AA
	}
	#d1{
		margin: 0px auto;
	}
	#p1{
		height: 60px;
		background-repeat: no-repeat;
	}
	#d2 table{
		width: 100%;
		text-align: center;
		margin-top: 20px;
	}
	#t1{
		background-color: #FCEC9A;
		border-color: #FFFFFF
	}
</style>
</head>
<body style="font-size:20px">
	<%@ include file="navigation.jsp" %>
	<div id="content">
		<p id="p"> 当前位置：仓库管理 > 门店库存信息>></p>
		<div id="d1">
			<div align="left">
				门店编号：<input id="shopId" name="shopId" size="32px">
				<input id="select" type="button" value="查询">
			</div>
		</div>
		<div id="d2">
			<table id="t1" border="1" cellpadding="0px" cellspacing="0px" align="center">
			</table>
		</div>
	</div>
	<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
	<script type="text/javascript">
		$(function(){
			$("#select").click(function(){
				var t = document.getElementById("t1");
				t.innerHTML = "<tr><td class=\"c1\">门店编号</td><td class=\"c1\">商品名称</td><td class=\"c1\">商品库存</td><td class=\"c1\">最近修改时间</td><td class=\"c1\">修改数量</td></tr>";
				var xhr = new XMLHttpRequest();
				xhr.onreadystatechange = function(){
					if(xhr.readyState==4 && xhr.status==200){
						var data = xhr.responseText;
						var obj = JSON.parse(data);
						for(var i=0;i<obj.length;i++){
							t.innerHTML += "<tr><td>"+obj[i].shopId+"</td><td>"+obj[i].goodsName+"</td><td>"+obj[i].goodsInventory
							+"</td><td>"+obj[i].updateTime+"</td><td><a href=\"${pageContext.request.contextPath}/toupdDepo.do?depositoryInfoId="+obj[i].depositoryInfoId+"\">"+
							"修改</a></td></tr>";
						}
						//t.innerHTML += "<tr><td colspan='5'>总借书："+obj.length+"册</td></tr>";
					}
				}
				xhr.open('get','depo_select.do?shopId='+$('#shopId').val(),true);
				xhr.send();
			});
		});
	</script>
</body>
</html>